import BTAction from "../../Base/BTAction";
import { NodeStatus } from "../../../common/Enum";
import Boss1Tree from "../Tree/Boss1Tree";

export default class ActionReduceCD extends BTAction {

    constructor(
        private tree: Boss1Tree
    ) {
        super()
    }
    onStart(): void {
        const enemy = this.tree.enemy
        if (enemy.shootCD != null && enemy.impactCD != null && this.tree.dt) {
            enemy.shootCD += this.tree.dt
            enemy.impactCD += this.tree.dt
        }
        super.onStart()
    }

    onEnd(): void {
        super.onEnd()
    }

    onUpdate(): NodeStatus {
        return NodeStatus.Success
    }
}